package com.zytech.zspider.core;

import com.zytech.modules.lang.Langs;

/**
 * @author siuming
 */
public final class TaskExceptions {

    /**
     * @param e
     * @return
     */
    public static TaskException transform(Exception e) {
        Throwable t = Langs.toUnwrap(e);
        if (t instanceof TaskException) {
            return (TaskException) t;
        }

        return new TaskException(e);
    }

    private TaskExceptions() {
    }
}
